export default {
  inserted(el, binding) {
    const infoStr = sessionStorage.getItem('ycloud-user_info')
    const userInfo = infoStr && JSON.parse(infoStr) || {}
    const {code,id} = binding.value
    const userPostCode = userInfo.currentPost.postCode


    // 需要判断userId 和 employeeId
    //code 满足条件
    const condition1 = userPostCode && userPostCode === code
    //id 满足条件
    const condition2 = id && userInfo && userInfo.id === id && userInfo.employee?.id === id

    // 2个条件满足其一就不删除
    if(!condition1 && !condition2){
      debugger
      el.parentNode && el.parentNode.removeChild(el)
      //el = null
      //console.log('删除按钮')
    }
  }
}
